

<!DOCTYPE html>
<html lang="zh-CN" data-default-color-scheme=auto>



<head>
  <meta charset="UTF-8">
  <link rel="apple-touch-icon" sizes="76x76" href="/img/favicon.png">
  <link rel="icon" href="/img/favicon.png">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=5.0, shrink-to-fit=no">
  <meta http-equiv="x-ua-compatible" content="ie=edge">
  
  <meta name="theme-color" content="#2f4154">
  <meta name="author" content="Fly542">
  <meta name="keywords" content="">
  
    <meta name="description" content="PrometheusPrometheus 安装与配置Prometheus为go语言开发的程序，运行时直接运行二进制即可。  下载二进制包从官方下载地址 下载最新的二进制程序包.  解压 12tar zxvf prometheus-2.51.1.linux-amd64.tar.gz ; mv prometheus-2.51.1 prometheus ; cd prometheus ;  修改配置文件">
<meta property="og:type" content="article">
<meta property="og:title" content="Prometheus与Grafana">
<meta property="og:url" content="http://fly542.cn/2024/04/22/04DevOps/33grafana/index.html">
<meta property="og:site_name" content="Fly542 技术沉淀">
<meta property="og:description" content="PrometheusPrometheus 安装与配置Prometheus为go语言开发的程序，运行时直接运行二进制即可。  下载二进制包从官方下载地址 下载最新的二进制程序包.  解压 12tar zxvf prometheus-2.51.1.linux-amd64.tar.gz ; mv prometheus-2.51.1 prometheus ; cd prometheus ;  修改配置文件">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="http://fly542.cn/2024/04/22/04DevOps/33grafana/prometheus_1.png">
<meta property="og:image" content="http://fly542.cn/2024/04/22/04DevOps/33grafana/grafana_3_1.png">
<meta property="og:image" content="http://fly542.cn/2024/04/22/04DevOps/33grafana/grafana_3_2.png">
<meta property="og:image" content="http://fly542.cn/2024/04/22/04DevOps/33grafana/grafana_3_3.png">
<meta property="og:image" content="http://fly542.cn/2024/04/22/04DevOps/33grafana/grafana_3_4.png">
<meta property="og:image" content="http://fly542.cn/2024/04/22/04DevOps/33grafana/grafana_3_5.png">
<meta property="og:image" content="http://fly542.cn/2024/04/22/04DevOps/33grafana/grafana_3_7.png">
<meta property="og:image" content="http://fly542.cn/2024/04/22/04DevOps/33grafana/grafana_3_6.png">
<meta property="og:image" content="http://fly542.cn/2024/04/22/04DevOps/33grafana/grafana_3_8.png">
<meta property="article:published_time" content="2024-04-22T02:51:02.000Z">
<meta property="article:modified_time" content="2024-04-22T05:37:29.806Z">
<meta property="article:author" content="Fly542">
<meta property="article:tag" content="linux">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:image" content="http://fly542.cn/2024/04/22/04DevOps/33grafana/prometheus_1.png">
  
  
  <title>Prometheus与Grafana - Fly542 技术沉淀</title>

  <link  rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4/dist/css/bootstrap.min.css" />


  <link  rel="stylesheet" href="https://cdn.jsdelivr.net/npm/github-markdown-css@4/github-markdown.min.css" />
  <link  rel="stylesheet" href="https://cdn.jsdelivr.net/npm/hint.css@2/hint.min.css" />

  
    
    
      
      <link  rel="stylesheet" href="https://cdn.jsdelivr.net/npm/highlight.js@10/styles/github-gist.min.css" />
    
  

  
    <link  rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@3/dist/jquery.fancybox.min.css" />
  


<!-- 主题依赖的图标库，不要自行修改 -->

<link rel="stylesheet" href="//at.alicdn.com/t/font_1749284_ba1fz6golrf.css">



<link rel="stylesheet" href="//at.alicdn.com/t/font_1736178_lbnruvf0jn.css">


<link  rel="stylesheet" href="/css/main.css" />

<!-- 自定义样式保持在最底部 -->


  <script id="fluid-configs">
    var Fluid = window.Fluid || {};
    var CONFIG = {"hostname":"fly542.cn","root":"/","version":"1.8.14","typing":{"enable":true,"typeSpeed":70,"cursorChar":"_","loop":false},"anchorjs":{"enable":true,"element":"h1,h2,h3,h4,h5,h6","placement":"right","visible":"hover","icon":""},"progressbar":{"enable":true,"height_px":3,"color":"#29d","options":{"showSpinner":false,"trickleSpeed":100}},"copy_btn":true,"image_zoom":{"enable":true,"img_url_replace":["",""]},"toc":{"enable":true,"headingSelector":"h1,h2,h3,h4,h5,h6","collapseDepth":0},"lazyload":{"enable":true,"loading_img":"/img/loading.gif","onlypost":false,"offset_factor":2},"web_analytics":{"enable":false,"baidu":null,"google":null,"gtag":null,"tencent":{"sid":null,"cid":null},"woyaola":null,"cnzz":null,"leancloud":{"app_id":null,"app_key":null,"server_url":null,"path":"window.location.pathname","ignore_local":false}},"search_path":"/local-search.xml"};
  </script>
  <script  src="/js/utils.js" ></script>
  <script  src="/js/color-schema.js" ></script>
<meta name="generator" content="Hexo 6.0.0"></head>


<body>
  <header style="height: 70vh;">
    <nav id="navbar" class="navbar fixed-top  navbar-expand-lg navbar-dark scrolling-navbar">
  <div class="container">
    <a class="navbar-brand" href="/">
      <strong>Fly542 技术沉淀</strong>
    </a>

    <button id="navbar-toggler-btn" class="navbar-toggler" type="button" data-toggle="collapse"
            data-target="#navbarSupportedContent"
            aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
      <div class="animated-icon"><span></span><span></span><span></span></div>
    </button>

    <!-- Collapsible content -->
    <div class="collapse navbar-collapse" id="navbarSupportedContent">
      <ul class="navbar-nav ml-auto text-center">
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/">
                <i class="iconfont icon-home-fill"></i>
                首页
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/archives/">
                <i class="iconfont icon-archive-fill"></i>
                归档
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/categories/">
                <i class="iconfont icon-category-fill"></i>
                分类
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/tags/">
                <i class="iconfont icon-tags-fill"></i>
                标签
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/about/">
                <i class="iconfont icon-user-fill"></i>
                关于
              </a>
            </li>
          
        
        
          <li class="nav-item" id="search-btn">
            <a class="nav-link" target="_self" href="javascript:;" data-toggle="modal" data-target="#modalSearch" aria-label="Search">
              &nbsp;<i class="iconfont icon-search"></i>&nbsp;
            </a>
          </li>
        
        
          <li class="nav-item" id="color-toggle-btn">
            <a class="nav-link" target="_self" href="javascript:;" aria-label="Color Toggle">&nbsp;<i
                class="iconfont icon-dark" id="color-toggle-icon"></i>&nbsp;</a>
          </li>
        
      </ul>
    </div>
  </div>
</nav>

    <div class="banner" id="banner" parallax=true
         style="background: url('/img/default.png') no-repeat center center;
           background-size: cover;">
      <div class="full-bg-img">
        <div class="mask flex-center" style="background-color: rgba(0, 0, 0, 0.3)">
          <div class="page-header text-center fade-in-up">
            <span class="h2" id="subtitle" title="Prometheus与Grafana">
              
            </span>

            
              <div class="mt-3">
  
  
    <span class="post-meta">
      <i class="iconfont icon-date-fill" aria-hidden="true"></i>
      <time datetime="2024-04-22 10:51" pubdate>
        2024年4月22日 上午
      </time>
    </span>
  
</div>

<div class="mt-1">
  
    <span class="post-meta mr-2">
      <i class="iconfont icon-chart"></i>
      2.6k 字
    </span>
  

  
    <span class="post-meta mr-2">
      <i class="iconfont icon-clock-fill"></i>
      
      
      23 分钟
    </span>
  

  
  
</div>

            
          </div>

          
        </div>
      </div>
    </div>
  </header>

  <main>
    
      

<div class="container-fluid nopadding-x">
  <div class="row nomargin-x">
    <div class="d-none d-lg-block col-lg-2"></div>
    <div class="col-lg-8 nopadding-x-md">
      <div class="container nopadding-x-md" id="board-ctn">
        <div class="py-5" id="board">
          <article class="post-content mx-auto">
            <!-- SEO header -->
            <h1 style="display: none">Prometheus与Grafana</h1>
            
            <div class="markdown-body">
              <h1 id="Prometheus"><a href="#Prometheus" class="headerlink" title="Prometheus"></a>Prometheus</h1><h2 id="Prometheus-安装与配置"><a href="#Prometheus-安装与配置" class="headerlink" title="Prometheus 安装与配置"></a>Prometheus 安装与配置</h2><p>Prometheus为go语言开发的程序，运行时直接运行二进制即可。</p>
<ul>
<li><p>下载二进制包<br>从<a target="_blank" rel="noopener" href="https://prometheus.io/download/">官方下载地址</a> 下载最新的二进制程序包.</p>
</li>
<li><p>解压</p>
<figure class="highlight apache"><table><tr><td class="gutter"><div class="code-wrapper"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></div></td><td class="code"><pre><code class="hljs apache"><span class="hljs-attribute">tar</span> zxvf prometheus-<span class="hljs-number">2</span>.<span class="hljs-number">51</span>.<span class="hljs-number">1</span>.linux-amd<span class="hljs-number">64</span>.tar.gz ; mv prometheus-<span class="hljs-number">2</span>.<span class="hljs-number">51</span>.<span class="hljs-number">1</span> prometheus ; <br><span class="hljs-attribute">cd</span> prometheus ; <br></code></pre></td></tr></table></figure></li>
<li><p>修改配置文件，定期从8088端口获取/metrics数据</p>
<figure class="highlight nginx"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs nginx"><span class="hljs-attribute">vim</span> prometheus.yml<br></code></pre></td></tr></table></figure>
<img src="/2024/04/22/04DevOps/33grafana/prometheus_1.png" srcset="/img/loading.gif" lazyload class=""></li>
<li><p>增加以下star.sh和stop.sh脚本来启停Prometheus</p>
</li>
</ul>
<p>start.sh</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br></pre></td><td class="code"><pre><code class="hljs bash"><span class="hljs-built_in">cd</span> `dirname <span class="hljs-variable">$0</span>`<br><br><span class="hljs-comment">#  是否显示执行过程</span><br><span class="hljs-comment">#set -x</span><br><br>cur_path=`<span class="hljs-built_in">pwd</span>`<br>file=<span class="hljs-string">&quot;<span class="hljs-variable">$&#123;cur_path&#125;</span>/prometheus&quot;</span><br><span class="hljs-keyword">if</span> [ -f <span class="hljs-variable">$&#123;file&#125;</span> ]<br><span class="hljs-keyword">then</span><br>    nohup <span class="hljs-variable">$&#123;file&#125;</span> &amp; &gt;/dev/null<br>    <span class="hljs-built_in">echo</span> <span class="hljs-string">&quot;start <span class="hljs-variable">$&#123;file&#125;</span>&quot;</span><br><span class="hljs-keyword">fi</span><br><br></code></pre></td></tr></table></figure>

<p>stop.sh</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><code class="hljs bash"><span class="hljs-meta">#!/bin/bash</span><br><span class="hljs-built_in">cd</span> `dirname <span class="hljs-variable">$0</span>`<br><br><span class="hljs-comment">#  是否显示执行过程</span><br><span class="hljs-comment">#set -x</span><br><br>killall prometheus<br><br></code></pre></td></tr></table></figure>

<ul>
<li>调用start.sh启动服务</li>
</ul>
<p>默认prometheus将在9000端口启动web服务，默认用户名和密码都为admin</p>
<figure class="highlight awk"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs awk">http:<span class="hljs-regexp">//</span><span class="hljs-number">127.0</span>.<span class="hljs-number">0.1</span>:<span class="hljs-number">9090</span><br></code></pre></td></tr></table></figure>

<h2 id="重要概念解释"><a href="#重要概念解释" class="headerlink" title="重要概念解释"></a>重要概念解释</h2><p><strong>指标（Metrics）</strong>：</p>
<p>指标是监控系统中记录的数据的基本单位。它代表了一种度量，通常表示了系统中某个特定方面的状态或性能指标。每个指标都有一个唯一的名称，并且可以随时间变化。</p>
<p>例如，CPU使用率、内存使用量、请求次数等都可以作为指标。</p>
<p><strong>标签（Labels）</strong>：</p>
<p>标签是用于标识和区分同一指标下不同维度的数据的键值对。它可以为指标提供更多的上下文信息，使得指标的数据更加丰富和有用。标签通常用于描述指标的特定属性或者维度，如主机名、数据中心、服务名称等。一个指标可以有零个或多个标签。</p>
<p>例如，对于一个请求计数器指标，可以使用标签来表示不同的请求路径、HTTP方法、状态码等。<br>总的来说，指标描述了被监控的量，而标签则为这些量提供了更详细的描述和区分。指标和标签的结合使得监控系统能够更好地理解和分析系统的状态和性能。</p>
<h1 id="Granafa-安装"><a href="#Granafa-安装" class="headerlink" title="Granafa 安装"></a>Granafa 安装</h1><h2 id="Granafa-docker安装"><a href="#Granafa-docker安装" class="headerlink" title="Granafa docker安装"></a>Granafa docker安装</h2><figure class="highlight apache"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs apache"><span class="hljs-attribute">docker</span> run -d -p <span class="hljs-number">3000</span>:<span class="hljs-number">3000</span> grafana/grafana<br></code></pre></td></tr></table></figure>

<h2 id="Granafa-配置"><a href="#Granafa-配置" class="headerlink" title="Granafa 配置"></a>Granafa 配置</h2><h2 id="Granafa-使用"><a href="#Granafa-使用" class="headerlink" title="Granafa 使用"></a>Granafa 使用</h2><h3 id="变量的配置与使用"><a href="#变量的配置与使用" class="headerlink" title="变量的配置与使用"></a>变量的配置与使用</h3><p>配置变量将在grafana的顶部显示一个变量的选择框，便于图形条件的过滤筛选。每建立一个将在顶部显示一个过滤条件。</p>
<h4 id="变量创建"><a href="#变量创建" class="headerlink" title="变量创建"></a>变量创建</h4><ul>
<li><p>点击dashboard中的设置按钮</p>
<img src="/2024/04/22/04DevOps/33grafana/grafana_3_1.png" srcset="/img/loading.gif" lazyload class=""></li>
<li><p>选择”变量”标签页，然后点击”New variable”创建新的变量</p>
<img src="/2024/04/22/04DevOps/33grafana/grafana_3_2.png" srcset="/img/loading.gif" lazyload class=""></li>
<li><p>根据需求修改变量内容</p>
<img src="/2024/04/22/04DevOps/33grafana/grafana_3_3.png" srcset="/img/loading.gif" lazyload class=""></li>
</ul>
<p>上图标号一般为必须填写的内容。按标号解释如下</p>
<table>
<thead>
<tr>
<th>标号</th>
<th>解释</th>
</tr>
</thead>
<tbody><tr>
<td>1</td>
<td>变量类型,Query 代表查询数据</td>
</tr>
<tr>
<td>2</td>
<td>变量名,用于panel中数据选择语句使用</td>
</tr>
<tr>
<td>3</td>
<td>标签名，即在列表选择时，列表前面显示的名字</td>
</tr>
<tr>
<td>4</td>
<td>在Dashboard中显示的内容，是否显示标签和内容，根据实际需要选择</td>
</tr>
<tr>
<td>5</td>
<td>数据来源，根据实际需要选择，因为我的数据来源于Prometheus，所以如图显示</td>
</tr>
<tr>
<td>6</td>
<td>查询类型，即列表内显示的内容是变量的名还是其他</td>
</tr>
<tr>
<td>7</td>
<td>所有指标中的某个特定指标(metrics)标签</td>
</tr>
<tr>
<td>8</td>
<td>要使用的metrics指标组</td>
</tr>
<tr>
<td>9</td>
<td>排序类型</td>
</tr>
<tr>
<td>10</td>
<td>刷新方式</td>
</tr>
<tr>
<td>11</td>
<td>列表选择模式，是否允许多选，是否显示全部</td>
</tr>
<tr>
<td>12</td>
<td>创建变量</td>
</tr>
</tbody></table>
<p>下图中的符号代表变量还未被使用</p>
<img src="/2024/04/22/04DevOps/33grafana/grafana_3_4.png" srcset="/img/loading.gif" lazyload class="">

<ul>
<li><p>点击上图右上角的”Save Dashboard”保存变量</p>
</li>
<li><p>配置成功后页面最终显示如下</p>
<img src="/2024/04/22/04DevOps/33grafana/grafana_3_5.png" srcset="/img/loading.gif" lazyload class=""></li>
</ul>
<h4 id="变量使用"><a href="#变量使用" class="headerlink" title="变量使用"></a>变量使用</h4><ul>
<li><p>编辑pannel,如下图</p>
<img src="/2024/04/22/04DevOps/33grafana/grafana_3_7.png" srcset="/img/loading.gif" lazyload class=""></li>
<li><p>使用变量对查询条件进行过滤<br>如下图:</p>
<img src="/2024/04/22/04DevOps/33grafana/grafana_3_6.png" srcset="/img/loading.gif" lazyload class="">
<blockquote>
<p>注意在标签步骤3中使用 <code>=~</code> 代表选择数据时使用正则表达式方式进行匹配</p>
</blockquote>
</li>
</ul>
<p>上图中如果标记5选择code模式则可以直接用文本方式编写标记6相关的 PromQL 语法语句</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs bash">increase(dn_city_isp_eq_counter&#123;domain=~<span class="hljs-string">&quot;<span class="hljs-variable">$doh_domain</span>&quot;</span>, continent=~<span class="hljs-string">&quot;<span class="hljs-variable">$doh_continent</span>&quot;</span>, country=~<span class="hljs-string">&quot;<span class="hljs-variable">$doh_country</span>&quot;</span>, isp=~<span class="hljs-string">&quot;<span class="hljs-variable">$doh_isp</span>&quot;</span>, province=~<span class="hljs-string">&quot;<span class="hljs-variable">$doh_province</span>&quot;</span>, eq=~<span class="hljs-string">&quot;<span class="hljs-variable">$doh_eq</span>&quot;</span>&#125;[1m])<br></code></pre></td></tr></table></figure>
<img src="/2024/04/22/04DevOps/33grafana/grafana_3_8.png" srcset="/img/loading.gif" lazyload class="">


<p>计算doh_recursion_total中eq选择项占所有前缀相同的记录的比例</p>
<figure class="highlight kotlin"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><code class="hljs kotlin">sum <span class="hljs-keyword">by</span> (domain) (<br>  rate(doh_recursion_total&#123;domain=~<span class="hljs-string">&quot;<span class="hljs-variable">$doh_domain</span>&quot;</span>, continent=~<span class="hljs-string">&quot;<span class="hljs-variable">$doh_continent</span>&quot;</span>, country=~<span class="hljs-string">&quot;<span class="hljs-variable">$doh_country</span>&quot;</span>, isp=~<span class="hljs-string">&quot;<span class="hljs-variable">$doh_isp</span>&quot;</span>, province=~<span class="hljs-string">&quot;<span class="hljs-variable">$doh_province</span>&quot;</span>, eq=~<span class="hljs-string">&quot;<span class="hljs-variable">$doh_eq</span>&quot;</span>&#125;[1m])<br>)<br>/<br>sum <span class="hljs-keyword">by</span> (domain) (<br>  rate(doh_recursion_total&#123;domain=~<span class="hljs-string">&quot;<span class="hljs-variable">$doh_domain</span>&quot;</span>, continent=~<span class="hljs-string">&quot;<span class="hljs-variable">$doh_continent</span>&quot;</span>, country=~<span class="hljs-string">&quot;<span class="hljs-variable">$doh_country</span>&quot;</span>, isp=~<span class="hljs-string">&quot;<span class="hljs-variable">$doh_isp</span>&quot;</span>, province=~<span class="hljs-string">&quot;<span class="hljs-variable">$doh_province</span>&quot;</span>&#125;[1m])<br>)<br></code></pre></td></tr></table></figure>
<p>其中sum by 为promql语法的按指定内容分组,</p>
<h1 id="参考"><a href="#参考" class="headerlink" title="参考"></a>参考</h1><p><a target="_blank" rel="noopener" href="https://yunlzheng.gitbook.io/prometheus-book">https://yunlzheng.gitbook.io/prometheus-book</a><br><a target="_blank" rel="noopener" href="https://www.jianshu.com/p/fe8bab704716">https://www.jianshu.com/p/fe8bab704716</a><br><a target="_blank" rel="noopener" href="https://blog.csdn.net/zhuchunyan_aijia/article/details/118151299">https://blog.csdn.net/zhuchunyan_aijia/article/details/118151299</a><br><a target="_blank" rel="noopener" href="https://www.cnblogs.com/gered/p/13994423.html#_label3">https://www.cnblogs.com/gered/p/13994423.html#_label3</a><br><a target="_blank" rel="noopener" href="https://juejin.cn/post/7162088398784725022">https://juejin.cn/post/7162088398784725022</a></p>

            </div>
            <hr>
            <div>
              <div class="post-metas mb-3">
                
                  <div class="post-meta mr-3">
                    <i class="iconfont icon-category"></i>
                    
                      <a class="hover-with-bg" href="/categories/devops/">devops</a>
                    
                  </div>
                
                
                  <div class="post-meta">
                    <i class="iconfont icon-tags"></i>
                    
                      <a class="hover-with-bg" href="/tags/linux/">linux</a>
                    
                  </div>
                
              </div>
              
                <p class="note note-warning">
                  
                    本博客所有文章除特别声明外，均采用 <a target="_blank" href="https://creativecommons.org/licenses/by-sa/4.0/deed.zh" rel="nofollow noopener noopener">CC BY-SA 4.0 协议</a> ，转载请注明出处！
                  
                </p>
              
              
                <div class="post-prevnext">
                  <article class="post-prev col-6">
                    
                    
                      <a href="/2024/05/13/03%E8%BD%AF%E4%BB%B6%E5%BC%80%E5%8F%91/07%E5%BA%94%E7%94%A8%E8%BD%AF%E4%BB%B6/DNS%20bind9%20%E6%BA%90%E7%A0%81%E5%88%86%E6%9E%90/">
                        <i class="iconfont icon-arrowleft"></i>
                        <span class="hidden-mobile">DNS bind9 源码分析</span>
                        <span class="visible-mobile">上一篇</span>
                      </a>
                    
                  </article>
                  <article class="post-next col-6">
                    
                    
                      <a href="/2024/04/07/04DevOps/32crontab%E4%BD%BF%E7%94%A8/">
                        <span class="hidden-mobile">crontab使用总结</span>
                        <span class="visible-mobile">下一篇</span>
                        <i class="iconfont icon-arrowright"></i>
                      </a>
                    
                  </article>
                </div>
              
            </div>

            
          </article>
        </div>
      </div>
    </div>
    
      <div class="d-none d-lg-block col-lg-2 toc-container" id="toc-ctn">
        <div id="toc">
  <p class="toc-header"><i class="iconfont icon-list"></i>&nbsp;目录</p>
  <div class="toc-body" id="toc-body"></div>
</div>

      </div>
    
  </div>
</div>

<!-- Custom -->


    

    
      <a id="scroll-top-button" aria-label="TOP" href="#" role="button">
        <i class="iconfont icon-arrowup" aria-hidden="true"></i>
      </a>
    

    
      <div class="modal fade" id="modalSearch" tabindex="-1" role="dialog" aria-labelledby="ModalLabel"
     aria-hidden="true">
  <div class="modal-dialog modal-dialog-scrollable modal-lg" role="document">
    <div class="modal-content">
      <div class="modal-header text-center">
        <h4 class="modal-title w-100 font-weight-bold">搜索</h4>
        <button type="button" id="local-search-close" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body mx-3">
        <div class="md-form mb-5">
          <input type="text" id="local-search-input" class="form-control validate">
          <label data-error="x" data-success="v"
                 for="local-search-input">关键词</label>
        </div>
        <div class="list-group" id="local-search-result"></div>
      </div>
    </div>
  </div>
</div>
    

    
  </main>

  <footer class="text-center mt-5 py-3">
  <div class="footer-content">
     <a href="https://hexo.io" target="_blank" rel="nofollow noopener"><span>Hexo</span></a> <i class="iconfont icon-love"></i> <a href="https://github.com/fluid-dev/hexo-theme-fluid" target="_blank" rel="nofollow noopener"><span>Fluid</span></a> 
  </div>
  

  

  
</footer>


  <!-- SCRIPTS -->
  
  <script  src="https://cdn.jsdelivr.net/npm/nprogress@0/nprogress.min.js" ></script>
  <link  rel="stylesheet" href="https://cdn.jsdelivr.net/npm/nprogress@0/nprogress.min.css" />

  <script>
    NProgress.configure({"showSpinner":false,"trickleSpeed":100})
    NProgress.start()
    window.addEventListener('load', function() {
      NProgress.done();
    })
  </script>


<script  src="https://cdn.jsdelivr.net/npm/jquery@3/dist/jquery.min.js" ></script>
<script  src="https://cdn.jsdelivr.net/npm/bootstrap@4/dist/js/bootstrap.min.js" ></script>
<script  src="/js/events.js" ></script>
<script  src="/js/plugins.js" ></script>

<!-- Plugins -->


  <script  src="/js/local-search.js" ></script>



  
    <script  src="/js/img-lazyload.js" ></script>
  



  



  
    <script  src="https://cdn.jsdelivr.net/npm/tocbot@4/dist/tocbot.min.js" ></script>
  
  
    <script  src="https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@3/dist/jquery.fancybox.min.js" ></script>
  
  
    <script  src="https://cdn.jsdelivr.net/npm/anchor-js@4/anchor.min.js" ></script>
  
  
    <script defer src="https://cdn.jsdelivr.net/npm/clipboard@2/dist/clipboard.min.js" ></script>
  






  <script  src="https://cdn.jsdelivr.net/npm/typed.js@2/lib/typed.min.js" ></script>
  <script>
    (function (window, document) {
      var typing = Fluid.plugins.typing;
      var title = document.getElementById('subtitle').title;
      
        typing(title);
      
    })(window, document);
  </script>















<!-- 主题的启动项 保持在最底部 -->
<script  src="/js/boot.js" ></script>


</body>
</html>
